package com.apobates.jforum2.troll.accounts.mapper;

import com.apobates.jforum2.troll.accounts.entity.MemberSocialInfo;
import com.apobates.jforum2.troll.accounts.stub.vo.MemberSocialVo;
import com.apobates.jforum2.troll.utils.core.api.OptionalEntityTransformMapper;
import java.util.Optional;

/**
 *
 * @author xiaofanku
 */
public class MemberSocialVoMapperEntity implements OptionalEntityTransformMapper<MemberSocialInfo, MemberSocialVo>{
    @Override
    public Optional<MemberSocialVo> transform(Optional<MemberSocialInfo> entity) {
        return entity.map(msi->{
            MemberSocialVo msv = new MemberSocialVo();
            msv.setId(msi.getId());
            //微博帐号
            msv.setWeibo(msi.getWeibo());
            //微信号
            msv.setWeixin(msi.getWeixin());
            //QQ号
            msv.setQq(msi.getQq());
            //邮箱地址
            msv.setEmail(msi.getEmail());
            //会员ID
            msv.setMember(msi.getMemberId());
            return msv;
        });
    }
}